{{- $github := dict "github" (dict "url" "https://github.com/%s") -}}
{{- $gitlab := dict "gitlab" (dict "url" "https://gitlab.com/%s") -}}
{{- $twitter := dict "twitter" (dict "url" "https://twitter.com/%s") -}}
{{- $facebook := dict "facebook" (dict "url" "https://facebook.com/%s") -}}
{{- $linkedin := dict "linkedin" (dict "url" "https://linkedin.com/%s") -}}
{{- $stackoverflow := dict "stackoverflow" (dict "url" "https://stackoverflow.com/users/%s" "icon" "stack-overflow") -}}
{{- $weibo := dict "weibo" (dict "url" "https://weibo.com/%s") -}}
{{- $zhihu := dict "zhihu" (dict "url" "https://www.zhihu.com/people/%s") -}}
{{- $quora := dict "quora" (dict "url" "https://www.quora.com/profile/%s") -}}
{{- $instagram := dict "instagram" (dict "url" "https://www.instagram.com/%s") -}}
{{- $tumblr := dict "tumblr" (dict "url" "https://%s.tumblr.com") -}}
{{- $reddit := dict "reddit" (dict "url" "https://www.reddit.com/user/%s") -}}
{{- $telegram := dict "telegram" (dict "url" "https://t.me/%s") -}}
{{- $qq := dict "qq" (dict "url" "http://wpa.qq.com/msgrd?v=3&uin=%s&site=qq&menu=yes") -}}
{{- $dockerhub := dict "dockerhub" (dict "url" "https://hub.docker.com/u/%s" "icon" "docker") -}}
{{- $bitbucket := dict "bitbucket" (dict "url" "https://bitbucket.org/%s") -}}
{{- $items := merge $github $gitlab $twitter $facebook $linkedin $stackoverflow $weibo $zhihu $quora $instagram $tumblr -}}
{{- $items = merge $items $reddit $telegram $qq $dockerhub $bitbucket -}}
<nav class="social-links nav my-2 justify-content-center">
{{- range $key, $user := .Site.Social -}}
  {{- if eq $key "email" -}}
  <li class="nav-item">
    <a class="nav-link social-link" href="mailto:{{ $user }}" title="{{ title $key }}">
      <i class="fas fa-fw fa-2x fa-envelope"></i>
    </a>
  </li>
  {{- else -}}
    {{- with index $items $key -}}
    <li class="nav-item">
      <a class="nav-link social-link" target="_blank" href="{{ printf .url $user }}" title="{{ title $key }}">
        <i class="fab fa-fw fa-2x fa-{{ default $key .icon }}"></i>
      </a>
    </li>
    {{- end -}}
  {{- end -}}
{{- end -}}
  {{- with .OutputFormats.Get "rss" -}}
  <li class="nav-item">
    <a class="nav-link social-link" target="_blank" href="{{ .Permalink }}" title="RSS">
      <i class="fas fa-fw fa-2x fa-rss"></i>
    </a>
  </li>
  {{- end -}}
</nav>
